// src/api/student.js

import request from '@/utils/request'

// 获取所有学生列表
export const getAllStudents = () => {
    return request.get('/student')
}

// 添加学生
export const addStudent = (student) => {
    return request.post('/student/add', student)
}

// 更新学生
export const updateStudent = (student) => {
    return request.put('/student/update', student)
}

// 删除学生
export const deleteStudent = (studentId) => {
    return request.delete(`/student/delete/${studentId}`)
}

// 根据 studentId 获取学生信息
export const getStudentById = (studentId) => {
    return request.get(`/student/get/${studentId}`)
}

// 分页获取学生列表
export const getStudentsByPage = (pageNum) => {
    return request.post('/student/page', { pageNum })
}
